<table id="dataTable"></table>

{include file="system@block/layui" /}

<script type="text/javascript">
    layui.use(['table', 'tool'], function() {
        var $ = layui.jquery;
        var table = layui.table;
        
        table.render({
            elem: '#dataTable'
            ,url: '{:url("", ["type"=>$type,"order_material_id"=>$orderMaterialId])}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,cellMinWidth: 80
            ,toolbar: true
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,cols: [[ //表头
            	{field: 'type', title:'工序', templet:function(d){return layui.tool.formatCheckclothShrinkType(d.type);}}
            	,{field: 'cloth_num', title:'布号'}
            	,{field: 'length', title:'长度'}
            	,{field: 'create_time', title:'完成时间',width:180, templet:function(d){return layui.util.toDateString(d.create_time*1000);}}
            	,{field: 'true_fabric_width', title:'实用布封',templet:function(d){return d.true_fabric_width}}
            	,{field: 'is_excess', title:'用料情况',templet:function(d){return d.is_excess > 0 ? '多料':''}}
            ]]
        });
    });
</script>